home *** CD-ROM | disk | FTP | other *** search
/ Champak 145 / (Vol 145) Dec 21 2011.iso / Games / Emilia.swf / scripts / frame_14 / DoAction.as
Encoding:
Text File  |  2011-12-21  |  5.2 KB  |  167 lines

  1. function top2()
  2. {
  3.    for(var _loc3_ in _root.jewelry_win.jewelry_btn)
  4.    {
  5.       if(typeof _root.jewelry_win.jewelry_btn[_loc3_] == "movieclip")
  6.       {
  7.          if(_root.jewelry_win.jewelry_btn[_loc3_]._name.substr(0,7) == "jewelry")
  8.          {
  9.             _root.jewelry_win.jewelry_btn[_loc3_].onRelease = function()
  10.             {
  11.                _root.mianban._visible = false;
  12.                var num = Number(this._name.substr(7,2));
  13.                if(_root.model_mc.model_earbob_mc._currentframe == num + 1)
  14.                {
  15.                   _root.model_mc.model_earbob_mc.gotoAndStop(1);
  16.                }
  17.                else
  18.                {
  19.                   Mouse.hide();
  20.                   if(num <= 5)
  21.                   {
  22.                      trace(num);
  23.                      this._visible = false;
  24.                      _root.cur3_mc.gotoAndStop(num + 1);
  25.                      this.onMouseDown = function()
  26.                      {
  27.                         sound_ini3();
  28.                         _root.model_mc.model_earbob_mc.gotoAndStop(num + 1);
  29.                         _root.cur3_mc.gotoAndStop(1);
  30.                         Mouse.show();
  31.                         this._visible = true;
  32.                         delete this.onMouseDown;
  33.                      };
  34.                   }
  35.                }
  36.                if(_root.model_mc.model_jewelry_mc._currentframe == num - 4)
  37.                {
  38.                   _root.model_mc.model_jewelry_mc.gotoAndStop(1);
  39.                   Mouse.show();
  40.                }
  41.                else if(num > 5 && num <= 10)
  42.                {
  43.                   trace(this._name);
  44.                   this._visible = false;
  45.                   _root.cur3_mc.gotoAndStop(num + 1);
  46.                   this.onMouseDown = function()
  47.                   {
  48.                      sound_ini3();
  49.                      _root.model_mc.model_jewelry_mc.gotoAndStop(num - 4);
  50.                      _root.cur3_mc.gotoAndStop(1);
  51.                      Mouse.show();
  52.                      trace(this._name);
  53.                      this._visible = true;
  54.                      delete this.onMouseDown;
  55.                   };
  56.                }
  57.             };
  58.          }
  59.       }
  60.    }
  61.    for(_loc3_ in _root.eye_win.eye_btn)
  62.    {
  63.       trace(_root.eye_win.eye_btn[_loc3_]);
  64.       if(typeof _root.eye_win.eye_btn[_loc3_] == "movieclip")
  65.       {
  66.          if(_root.eye_win.eye_btn[_loc3_]._name.substr(0,3) == "eye")
  67.          {
  68.             _root.eye_win.eye_btn[_loc3_].onRelease = function()
  69.             {
  70.                _root.mianban._visible = false;
  71.                var num = Number(this._name.substr(3,2));
  72.                trace(num);
  73.                Mouse.hide();
  74.                this._visible = false;
  75.                _root.cur5_mc.gotoAndStop(num + 1);
  76.                this.onMouseDown = function()
  77.                {
  78.                   sound_ini3();
  79.                   _root.model_mc.eye_mc.gotoAndStop(num + 1);
  80.                   _root.cur5_mc.gotoAndStop(1);
  81.                   Mouse.show();
  82.                   this._visible = true;
  83.                   delete this.onMouseDown;
  84.                };
  85.             };
  86.          }
  87.       }
  88.    }
  89.    for(_loc3_ in _root.hair_win.hair_btn)
  90.    {
  91.       trace(_root.hair_win.hair_btn[_loc3_]);
  92.       if(typeof _root.hair_win.hair_btn[_loc3_] == "movieclip")
  93.       {
  94.          if(_root.hair_win.hair_btn[_loc3_]._name.substr(0,4) == "hair")
  95.          {
  96.             _root.hair_win.hair_btn[_loc3_].onRelease = function()
  97.             {
  98.                _root.mianban._visible = false;
  99.                sound_ini4();
  100.                var _loc3_ = Number(this._name.substr(4,2));
  101.                _root.fair_movie.n = _loc3_;
  102.                _root.fair_movie.gotoAndPlay(2);
  103.             };
  104.          }
  105.       }
  106.    }
  107.    for(_loc3_ in _root.tools_win)
  108.    {
  109.       trace(_root.tools_win[_loc3_]);
  110.       if(typeof _root.tools_win[_loc3_] == "movieclip")
  111.       {
  112.          if(_root.tools_win[_loc3_]._name.substr(0,5) == "tools")
  113.          {
  114.             _root.tools_win[_loc3_].onRelease = function()
  115.             {
  116.                var _loc3_ = Number(this._name.substr(5,2));
  117.                _root.mianban._visible = true;
  118.                _root.mianban.gotoAndStop(_loc3_ + 1);
  119.             };
  120.          }
  121.       }
  122.    }
  123. }
  124. function girl2()
  125. {
  126.    this.model_mc._x = this.model_mc.x0 - 250;
  127.    this.model_mc._y = this.model_mc.y0 + 70;
  128.    this.model_mc._xscale = this.model_mc._yscale = 350;
  129.    this.model_mc._rotation = 0;
  130. }
  131. function sound_ini3()
  132. {
  133.    _root.bg3_sound = new Sound();
  134.    _root.bg3_sound.attachSound("s3");
  135.    _root.bg3_sound.start();
  136.    _root.bg3_sound.setVolume(100);
  137. }
  138. function sound_ini4()
  139. {
  140.    _root.bg4_sound = new Sound();
  141.    _root.bg4_sound.attachSound("s4");
  142.    _root.bg4_sound.start();
  143.    _root.bg4_sound.setVolume(100);
  144. }
  145. function sound_ini()
  146. {
  147.    stopAllSounds();
  148.    _root.bg2_sound = new Sound();
  149.    _root.bg2_sound.attachSound("s1");
  150.    _root.bg2_sound.start(0,999);
  151.    _root.bg2_sound.setVolume(100);
  152. }
  153. stop();
  154. this.onEnterFrame = function()
  155. {
  156.    var _loc2_ = 1;
  157.    while(_loc2_ <= 6)
  158.    {
  159.       _root["cur" + _loc2_ + "_mc"]._x = _xmouse;
  160.       _root["cur" + _loc2_ + "_mc"]._y = _ymouse;
  161.       _loc2_ = _loc2_ + 1;
  162.    }
  163. };
  164. top2();
  165. girl2();
  166. sound_ini();
  167.